<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "https://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-CN"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta http-equiv="Content-Language" content="zh-CN"><link href="stylesheet.css" media="all" rel="stylesheet" type="text/css">
<title>DROP TABLESPACE</title>
<script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?d286c55b63a3c54a1e43d10d4c203e75"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script>
</head><body class="REFENTRY">
<div>
<table summary="Header navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><th colspan="5" align="center" valign="bottom">PostgreSQL 8.2.3 中文文档</th></tr>
<tr><td width="10%" align="left" valign="top"><a href="sql-droptable.html" accesskey="P">后退</a></td><td width="10%" align="left" valign="top"><a href="sql-droptable.html">快退</a></td><td width="60%" align="center" valign="bottom"></td><td width="10%" align="right" valign="top"><a href="sql-droptrigger.html">快进</a></td><td width="10%" align="right" valign="top"><a href="sql-droptrigger.html" accesskey="N">前进</a></td></tr>
</table>
<hr align="LEFT" width="100%"></div>
<h1><a name="SQL-DROPTABLESPACE"></a>DROP TABLESPACE</h1>
<div class="REFNAMEDIV"><a name="AEN51361"></a><h2>名称</h2>DROP TABLESPACE&nbsp;--&nbsp;删除一个表空间</div>
<a name="AEN51364"></a>
<div class="REFSYNOPSISDIV"><a name="AEN51366"></a><h2>语法</h2>
<pre class="SYNOPSIS">DROP TABLESPACE [ IF EXISTS ] <tt class="REPLACEABLE"><i>tablespacename</i></tt></pre>
</div>
<div class="REFSECT1"><a name="AEN51369"></a><h2>描述</h2>
<p><tt class="COMMAND">DROP TABLESPACE</tt> 从系统里删除一个表空间。</p>
<p>一个表空间只能由其所有者或者超级用户删除。在删除一个表空间之前，表空间里面不能有任何数据库对象。即使当前数据库里面已经没有任何对象在使用这个表空间了，也有可能有其它的数据库对象存留在这个表空间里。</p>
</div>
<div class="REFSECT1"><a name="AEN51374"></a><h2>参数</h2>
<div class="VARIABLELIST">
<dl>
<dt><tt class="LITERAL">IF EXISTS</tt></dt>
<dd><p>如果指定的表空间不存在，那么发出一个 notice 而不是抛出一个错误。</p></dd>
<dt><tt class="REPLACEABLE"><i>tablespacename</i></tt></dt>
<dd><p>表空间的名字</p></dd>
</dl>
</div>
</div>
<div class="REFSECT1"><a name="AEN51387"></a><h2>注意</h2>
<p><tt class="COMMAND">DROP TABLESPACE</tt> 不能出现在事务块内部。</p>
</div>
<div class="REFSECT1"><a name="AEN51391"></a><h2>例子</h2>
<p>从系统里删除表空间 <tt class="LITERAL">mystuff</tt> ：</p>
<pre class="PROGRAMLISTING">DROP TABLESPACE mystuff;</pre>
</div>
<div class="REFSECT1"><a name="AEN51396"></a><h2>兼容性</h2>
<p><tt class="COMMAND">DROP TABLESPACE</tt> 是 PostgreSQL 扩展</p>
</div>
<div class="REFSECT1"><a name="AEN51401"></a><h2>又见</h2><a href="sql-createtablespace.html"><i>CREATE TABLESPACE</i></a>, <a href="sql-altertablespace.html"><i>ALTER TABLESPACE</i></a></div>
<div>
<hr align="LEFT" width="100%">
<table summary="Footer navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td width="33%" align="left" valign="top"><a href="sql-droptable.html" accesskey="P">后退</a></td><td width="34%" align="center" valign="top"><a href="index.html" accesskey="H">首页</a></td><td width="33%" align="right" valign="top"><a href="sql-droptrigger.html" accesskey="N">前进</a></td></tr>
<tr><td width="33%" align="left" valign="top">DROP TABLE</td><td width="34%" align="center" valign="top"><a href="sql-commands.html" accesskey="U">上一级</a></td><td width="33%" align="right" valign="top">DROP TRIGGER</td></tr>
</table>
</div>
</body></html>